package Q3;

import java.io.File;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Thread {
    public static void main(String[] args) {


        //创立线程池
        ExecutorService executorService = Executors.newFixedThreadPool(3);

        File copyFile = new File("D:/copyfile");
        File pasteFile = new File("D:/pastefile");



        File[] files = copyFile.listFiles();
            for (File file : files) {
                System.out.println("开始");
                executorService.submit(new CopyMoveFiles(file, pasteFile));
            }


        //关闭线程池
        executorService.shutdown();

    }
}
